<?php
 
 class HomeController extends AppController{
  public $name = 'Home';
 	public $uses = array('Station','Tax','Bus','Line','Parking');

  public function beforeFilter(){
      parent::beforeFilter();
      $this->Auth->allow('index');
    }

  //   public function isAuthorized($user){
  //     // if (in_array($this->action, array('edit', 'delete','add','view'))){
  //     //   // if ($user['role'] != 'Admin'){
  //     //   //   return false;
  //     //   // }
  //     // }
    
  //     return true;
  //   }

  public function index($id = null) {
    $title_for_layout = 'Bem Vindo : Vai de Metro';
    $this->layout = 'base';
  	$this->set('filters', 'hide');
		
    if ($this->request->is('get')){
      $this->set('filtros', 'esconder');
			if ($id == 'bus') {
        $this->bus();
			}

			if ($id == 'car') {
        $this->set('type', 'car'); 
        $this->car();
			}
      
			if ($id == 'feet') {
        $this->feet();
			}

		}	
  }
}
  // public function beforeFilter(){
  //     parent::beforeFilter();
  //     $this->Auth->allow('index');
  //   }

  //   public function isAuthorized($user){
  //     if (in_array($this->action, array('edit', 'delete','add','view'))){
  //       // if ($user['role'] != 'Admin'){
  //       //   return false;
  //       // }
  //     }
    
  //     return true;
  //   }    	

?>